" for C 
" 为C语言选择特定的Colorscheme
au BufRead,BufNewFile *.c       colorscheme inkpot
"""""""""""""""""""""C语言编译执行快捷键"""""""""""""""""""""""""""""
"用gcc快速编译当前文件
"nnoremap <Leader>g <Esc>:!gcc % -o %:r.exe<CR>
nnoremap <Leader>g <Esc>:AsyncRun -mode=term -pos=xterm gcc % -o %:r.exe<CR>
"快速执行当前目录下编译出来的文件
"nnoremap <Leader>r <Esc>:!./%:r.exe<CR>
nnoremap <Leader>r <Esc>:AsyncRun -mode=term -pos=xterm ./%:r.exe<CR>

" auto add file header
autocmd BufNewFile *.c :0r $VIM_PATH/templates/cTmp.txt
autocmd BufNewFile *.c ks|call FileName()|'s
autocmd BufNewFile *.c ks|call Version()|'s
autocmd BufNewFile *.c ks|call CreatedTime()|'s
autocmd FileWritePre,BufWritePre *.c ks|call ModifyTime()|'s
autocmd BufNewFile *.c ks|call Author()|'s
autocmd BufNewFile *.c ks|call Copyright()|'s
autocmd BufNewFile *.c ks|call Description()|'s
autocmd BufNewFile *.c normal 8G$vb
autocmd FileWritePre,BufWritePre *.c 0,10g/Version/norm! $

" end auto add file header
